// normalizeStyle: 保证样式字段合法
export function normalizeStyle(style) {
  const result = { ...style }
  const styleKeys = ['left', 'top', 'width', 'height']
  
  styleKeys.forEach(key => {
    let val = result[key]
    if (val !== undefined && val !== null && val !== '') {
      result[key] = `${parseInt(val, 10)}px`
    }
  })
  
  return result
} 